package org.cuatrovientos.cadena;

import static org.junit.Assert.*;

import org.junit.Test;


/**
 * 
 * @author daniel_ancin
 *
 */
public class CadenaTest {
		

	/**
	 * Test method for {@link Cadena#longitud(java.lang.String)}.
	 */
	@Test
	public void testLength() {
		Cadena cadena= new Cadena();
		assertEquals(cadena.length("Daniel"),6);
		assertEquals(cadena.length(""),0);
		
	}
	
	/**
	 * Test method for {@link Cadena#vocales(java.lang.String)}.
	 */
	@Test
	public void testVocales() {
		Cadena cadena= new Cadena();
		assertEquals(cadena.vocales("Judo"),2);
		assertEquals(cadena.length(""),0);
	}
	
	/**
	 * Test method for {@link Cadena#invert(java.lang.String)}.
	 */

	@Test
	public void testInvert() {
		Cadena cadena= new Cadena();
		assertEquals(cadena.invert("Futbol"),"lobtuF");
		assertEquals(cadena.invert(""),"");
	}
	
	/**
	 * Test method for {@link Cadena#contarLetra(java.lang.String, char)}.
	 */
	@Test
	public void testContarLetra() {
		Cadena cadena= new Cadena();
		assertEquals(cadena.contarLetra("Patata", 't'),2);
		assertEquals(cadena.contarLetra("",'a'),0);
	}

}
